package server.connector.http;
/*
用于存放HTTP报文的一个请求头
 */

/*
2023/1/17 该类内容全部写完,后续直接使用,无需修改
by cyl
 */
final class HttpHeader {
    //常量
    private static final int INITIAL_NAME_SIZE = 32;
    private static final int INITIAL_VALUE_SIZE = 64;

    public static final int MAX_NAME_SIZE = 128;
    public static final int MAX_VALUE_SIZE = 4096;
    // 实例变量
    char[] name;
    char[] value;
    int nameLength;
    int valueLength;

    //构造器
    public HttpHeader() {
        this.name = new char[INITIAL_NAME_SIZE];
        this.value = new char[INITIAL_VALUE_SIZE];
        this.nameLength = 0;
        this.valueLength = 0;
    }

    //重新使用
    public void reuse() {
        nameLength = 0;
        valueLength = 0;
    }

}
